function [dcm] = plotxcorrs(XC)
%
% plot XCRESULT data into a multiplot.....
a=unique([XC.R1]);
la =length(a);
inda = [1:la]; % index into dataset.....
b=unique([XC.R2]);
lb = length(b);
indb = [1:lb];

[h, hfig] = multiplot('XCORRS', length(a), length(b), 1);

k=1;
dcm = zeros(length(XC),1);
cxmax = 0;
for i = 1:la
    r = find([XC.R1] == a(i))
    if(~isempty(r))
        for j = 1:length(r)
            hindx = (i-1)*la+j;
            plot(h(hindx), XC(r(j)).lags, XC(r(j)).cx);
            dcm(k) = max(XC(r(j)).cx);
            if(dcm(k) > cxmax)
                cxmax = dcm(k);
            end;
            k = k + 1;
        end;
    end;
end;


set(h, 'Ylim', [0 cxmax]);

